﻿using MediatR;
using S.Eartag.Domain.Model;
using S.Eartag.Infrastructure.Interface;
using S.Eartag.Read.API.Application.Command.LamBingCommand;

namespace S.Eartag.Read.API.Application.CommandHandlers.LamBingCommandHandler
{
    public class LamBingFindCommandHandler : IRequestHandler<LamBingFindCommand, LamBing>
    {
        private readonly ILamBingRepository lamBingRepository;

        public LamBingFindCommandHandler(ILamBingRepository lamBingRepository)
        {
            this.lamBingRepository = lamBingRepository;
        }

        public async Task<LamBing> Handle(LamBingFindCommand request, CancellationToken cancellationToken)
        {
            return await lamBingRepository.Get(request.id);
        }
    }
}
